#!/bin/bash
if [ "${1}" == "" ]; then
	echo "Usage: ${0} <PATH>"
	exit
fi
get_p(){
	path=$1
	echo $path | grep -q '^/' || path=$PWD/$path
	echo $path
}
path=$(get_p $1)
echo "the path is:"$path

# Remove all *.pyc file.
for var in `find $path | grep -i "pyc$"` 
do 
	echo $var && rm $var && echo "rm $var done"
done
# Remove all *~ file.
for var in `find $path | grep -i "~$"` 
do 
	echo $var && rm $var && echo "rm $var done"
done

# Remove all .sconsign.
find $path -name .sconsign | xargs rm -vf

